import request from '@/utils/request'


///新增退场申请
export function retirePost(data) {
	return request({
		'url': '/golden/exit/apply',
		'method': 'post',
		'data': data
	})
}

//退场申请列表-工人
export function retireList(data) {
	return request({
		'url': '/golden/exit/apply/list',
		'method': 'get',
		'data': data
	})
}

//退场申请列表-工人
export function retireLeaderList(data) {
	return request({
		'url': '/golden/exit/apply/leaderList',
		'method': 'get',
		'data': data
	})
}

//当前用户最后工作日期
export function lastWorkDate(projectId) {
	return request({
		'url': `/golden/exit/apply/getLastWorkDate/${projectId}`,
		'method': 'get',
	})
}

//可退场项目
export function retireProject(projectId) {
	return request({
		'url': `/golden/exit/apply/entrylist`,
		'method': 'get',
	})
}

//管理员审核
export function manageAudit(data) {
	return request({
		'url': '/golden/exit/apply/managerAudit',
		'method': 'put',
		'data': data
	})
}


//班组长审核
export function leaderAudit(data) {
	return request({
		'url': '/golden/exit/apply/leaderAudit',
		'method': 'put',
		'data': data
	})
}

//退场详情
export function retireDetail(id) {
	return request({
		'url': `/golden/exit/apply/${id}`,
		'method': 'get',
	})
}


////////退场结算
//审核退场结算- 项目管理员
export function settleManagerAudit(data) {
	return request({
		'url': '/golden/exitclear/applay/managerAudit',
		'method': 'put',
		'data': data
	})
}

//审核退场结算-班组长
export function settleLeaderAudit(data) {
	return request({
		'url': '/golden/exitclear/applay/leaderAudit',
		'method': 'put',
		'data': data
	})
}

//新增退场结算申请
export function settlePost(data) {
	return request({
		'url': '/golden/exitclear/applay',
		'method': 'post',
		'data': data
	})
}

//退场结算申请详情
export function settleDetail(id) {
	return request({
		'url': `/golden/exitclear/applay/${id}`,
		'method': 'get',
	})
}

//退场结算申请项目
export function settleProject(data) {
	return request({
		'url': '/golden/exitclear/applay/projectlist',
		'method': 'get',
		'data': data
	})
}

//退场结算申请项目列表-工人
export function settleList(data) {
	return request({
		'url': '/golden/exitclear/applay/list',
		'method': 'get',
		'data': data
	})
}

//退场结算申请项目列表-班管
export function settleLeaderList(data) {
	return request({
		'url': '/golden/exitclear/applay/leaderList',
		'method': 'get',
		'data': data
	})
}

//发起退场合同签订/app/golden/exit/apply/sign
export function exitSign(data) {
	return request({
		'url': '/golden/exit/apply/sign',
		'method': 'post',
		'data': data
	})
}
//获取退场申请详细信息
export function exitDetail(id) {
	return request({
		'url': `/app/golden/exit/apply/${id}`,
		'method': 'get',
	})
}

//审核员工退场-班组长(批量)
export function leaderAuditbatch(data) {
	return request({
		'url': '/golden/exit/apply/leaderAuditbatch',
		'method': 'put',
		'data': data
	})
}

//审核员工退场-项目管理员(批量)
export function managerAuditbatch(data) {
	return request({
		'url': '/golden/exit/apply/managerAuditbatch',
		'method': 'put',
		'data': data
	})
}


//组长是否绑定工人
export function isTeamBind(data) {
	return request({
		'url': '/users/team/bind',
		'method': 'get',
		'data': data
	})
}
//班组长解绑
export function teamUnbind(data) {
	return request({
		'url': '/users/team/unbind',
		'method': 'get',
		'data': data
	})
}
//查询项目其他班组长(不包括本人)
export function queryTeamList(projectId) {
	return request({
		'url': `/users/team/list/${projectId}`,
		'method': 'get',
		// 'data': data
	})
}
// 查询是否能退场申请结算
export function canSettle(data) {
	return request({
		'url': '/golden/exitclear/applay/canClear',
		'method': 'get',
		'data': data
	})
}

// 申请结算没有异常： GET /app/golden/exitclear/applay/calculateLeftSalary
export function calculateLeftSalary(data) {
	return request({
		'url': '/golden/exitclear/applay/calculateLeftSalary',
		'method': 'get',
		'data': data
	})
}

//在查项目其他班组长为空时，调用此接口。如果接口没有异常，并且响应 data 为 true，可以继续调用退场申请
export function canExit(data) {
	return request({
		'url': '/golden/exit/apply/canExit',
		'method': 'get',
		'data': data
	})
}